home *** CD-ROM | disk | FTP | other *** search
/ Amiga Format CD 41 / Amiga Format CD41 (1999-06)(Future Publishing)(GB)[!][issue 1999-07].iso / -seriously_amiga- / programming / other / gtlayout / source / lt_createhandle.c < prev    next >
C/C++ Source or Header  |  1999-04-19  |  16KB  |  623 lines

  1. /*
  2. **    GadTools layout toolkit
  3. **
  4. **    Copyright © 1993-1998 by Olaf `Olsen' Barthel
  5. **        Freely distributable.
  6. **
  7. **    :ts=4
  8. */
  9.  
  10. #ifndef _GTLAYOUT_GLOBAL_H
  11. #include "gtlayout_global.h"
  12. #endif
  13.  
  14. /*****************************************************************************/
  15.  
  16. #include <exec/memory.h>
  17.  
  18. #include <clib/keymap_protos.h>
  19. #include <pragmas/keymap_pragmas.h>
  20.  
  21. #include <stdarg.h>
  22.  
  23. /*****************************************************************************/
  24.  
  25. #include "Assert.h"
  26.  
  27. LayoutHandle * LIBENT
  28. LT_CreateHandle(REG(a0) struct Screen *Screen,REG(a1) struct TextAttr *Font)
  29. {
  30.     return(LT_CreateHandleTags(Screen,
  31.         LH_Font,Font,
  32.     TAG_DONE));
  33. }
  34.  
  35.  
  36. /*****************************************************************************/
  37.  
  38.  
  39. LayoutHandle *
  40. LT_CreateHandleTags(struct Screen *Screen,...)
  41. {
  42.     LayoutHandle    *Handle;
  43.     va_list          VarArgs;
  44.  
  45.     va_start(VarArgs,Screen);
  46.     Handle = LT_CreateHandleTagList(Screen,(struct TagItem *)VarArgs);
  47.     va_end(VarArgs);
  48.  
  49.     return(Handle);
  50. }
  51.  
  52.  
  53. /*****************************************************************************/
  54.  
  55.  
  56. /****** gtlayout.library/LT_CreateHandleTagList ******************************************
  57. *
  58. *   NAME
  59. *    LT_CreateHandleTagList -- Allocate auxilary data required by LT_New()
  60. *                              and LT_BuildA().
  61. *
  62. *   SYNOPSIS
  63. *    Handle = LT_CreateHandleTagList(Screen,Tags);
  64. *      D0                              A0    A1
  65. *
  66. *    LayoutHandle *LT_CreateHandleTagList(struct Screen *,struct TagItem *);
  67. *
  68. *    Handle = LT_CreateHandleTags(Screen,...);
  69. *
  70. *    struct LayoutHandle *LT_CreateHandleTags(struct Screen *,...);
  71. *
  72. *   FUNCTION
  73. *    Memory is allocated, tables are set up and data is collected
  74. *    on a screen a user interface is to be opened on. This
  75. *    involves calculating the screen font parameters.
  76. *
  77. *   INPUTS
  78. *    Screen - Pointer to the screen the user interface is to
  79. *        use. Passing NULL will cause the default public
  80. *        screen to be used.
  81. *
  82. *            NOTE: if NULL is passed the default public screen
  83. *                will stay locked until LT_DeleteHandle()
  84. *                is called.
  85. *
  86. *    Tags - Tag values to control certain aspects of the
  87. *        user interface created.
  88. *
  89. *
  90. *    Valid tags include:
  91. *
  92. *    LAHN_AutoActivate (BOOL) - Set to TRUE if you want the interface
  93. *        to always keep a string gadget active if possible. Hitting
  94. *        the return key will then cause the next following string
  95. *        gadget to get activated, either cycling through all the
  96. *        string gadgets available or stopping at the next string
  97. *        gadget to have the LAST_LastGadget attribute set.
  98. *        Default: TRUE
  99. *
  100. *    LAHN_RawKeyFilter (BOOL) - Discard unprocessed IDCMP_RAWKEY
  101. *        events. (V13)
  102. *        Default: TRUE
  103. *
  104. *    LAHN_UserData (APTR) - Store user specific data in the
  105. *        LayoutHandle->UserData entry.
  106. *
  107. *            NOTE: This tag requires gtlayout.library v9 and the
  108. *                corresponding entry in the LayoutHandle exists
  109. *                only under gtlayout.library v9 and up. *NEVER*
  110. *                write to this entry, use LT_SetAttributes()
  111. *                instead.
  112. *
  113. *    LAHN_LocaleHook (struct Hook *) - The hook to call when
  114. *        locale string IDs are to be mapped to strings. The
  115. *        hook function is called with the following parameters:
  116. *
  117. *        String = HookFunc(struct Hook *Hook,struct LayoutHandle *Handle,
  118. *          D0                            A0                         A2
  119. *                          LONG ID)
  120. *                               A1
  121. *
  122. *        The function is to look up the string associated with the ID
  123. *        passed in and return the string.
  124. *        Default: no locale hook
  125. *
  126. *    LAHN_TextAttr (struct TTextAttr *) - The text font to use when
  127. *        creating the gadgets and objects.
  128. *        Default: Screen->Font
  129. *
  130. *    LAHN_CloningPermitted (BOOL) - If a window will not fit onto the
  131. *        screen the user interface is intended for, the layout engine
  132. *        will scale the interface data down while stepping down in
  133. *        font size. If all this fails, the engine will open a custom
  134. *        screen for the window; this process is called "cloning".
  135. *        The LAHN_CloningPermitted tag controls whether the engine will
  136. *        actually try to open the custom screen or just return NULL
  137. *        when LT_Build fails.
  138. *        Default: TRUE
  139. *
  140. *    LAHN_EditHook (struct Hook *) - You can specify a default string
  141. *        gadget editing hook to be used for all following string
  142. *        gadgets. Your hook should obey the same rules that apply
  143. *        to hooks passed via GTST_EditHook/GTIN_EditHook.
  144. *        Default: NULL
  145. *
  146. *    LAHN_ExactClone (BOOL) - This tag works in conjunction with the
  147. *        LAHN_CloningPermitted tag. By default the layout engine will
  148. *        try to replicate only the basic characteristics of the
  149. *        screen the window was intended to open on. This may result
  150. *        in a screen which uses less colours than the original
  151. *        screen. You can force the engine to make an almost exact
  152. *        clone of the original screen by passing the LAHN_ExactClone
  153. *        tag with a value of TRUE.
  154. *        Default: FALSE
  155. *
  156. *    LAHN_MenuGlyphs (BOOL) - This tag will make the layout engine
  157. *        fill in the AmigaGlyph and CheckGlyph entries of the
  158. *        LayoutHandle if running under Kickstart 3.0 or higher.
  159. *        The corresponding images will be scaled to fit the actual
  160. *        screen aspect ratio values and can later be used for
  161. *        menu layout.
  162. *        Default: FALSE
  163. *
  164. *    LAHN_Parent (struct Window *) - You can pass a pointer to the
  165. *        parent window of the window you intend to open using
  166. *        the user interface layout engine. The new window will
  167. *        open inside the boundaries of the parent window. If the
  168. *        size does not fit, it will be opened centered over the
  169. *        parent window.
  170. *        Default: NULL
  171. *
  172. *    LAHN_BlockParent (BOOL) - This tag works in conjunction with the
  173. *        LAHN_Parent tag. If in effect, will block the parent window
  174. *        via LT_LockWindow until the new window is closed, after
  175. *        which the parent window is unlocked again.
  176. *        Default: FALSE
  177. *
  178. *    LAHN_SimpleClone (BOOL) - This tag works in conjunction with the
  179. *        LAHN_CloningPermitted tag. It will make the layout engine
  180. *        forget most information about the original screen the
  181. *        user interface was intended for. In short, it will open a
  182. *        simple default screen for the interface.
  183. *        Default: FALSE
  184. *
  185. *    LAHN_ExitFlush (BOOL) - When the LayoutHandle is finally disposed
  186. *        of with LT_DeleteHandle() all variables maintained by the
  187. *        input handling code will be flushed. For example, if you
  188. *        would use the LA_STRPTR tag for STRING_KIND objects the
  189. *        last string gadget contents would be copied into the buffer
  190. *        pointed to by LA_STRPTR. If you do not want to use this
  191. *        feature, disable it with "LAHN_ExitFlush,FALSE". (V9)
  192. *        Default: TRUE
  193. *
  194. *    LAHN_NoKeys (BOOL) - Use TRUE to tell the library not to pick
  195. *        keyboard shortcuts all on its own. This works like calling
  196. *        LT_New() for all objects with "LA_NoKey,TRUE,". (V26)
  197. *
  198. *    LAHN_PubScreen (struct Screen *) - Pointer to public screen
  199. *        window is to open on. Must be locked and open until you call
  200. *        LT_Built().
  201. *
  202. *    LAHN_PubScreenName (STRPTR) - Name of public screen to open window
  203. *        on. The library will try to lock the named screen as soon as
  204. *        you call LT_CreateHandle.
  205. *
  206. *    LAHN_PubScreenFallBack (BOOL) - If the named public screen cannot
  207. *        be found and you ask for it, the library will lock the default
  208. *        public screen (default: TRUE).
  209. *
  210. *    LAHN_TopGroupType (LONG) - Request that after creating the layout
  211. *        handle, a layout group should be added to it. This can be
  212. *        either a vertical or a horizontal group. You specify the type
  213. *        using VERTICAL_KIND or HORIZONTAL_KIND (default: don't add
  214. *        any group). (V45)
  215. *
  216. *   RESULT
  217. *    Handle - Pointer to a LayoutHandle structure.
  218. *
  219. ******************************************************************************
  220. *
  221. */
  222.  
  223. LayoutHandle * LIBENT
  224. LT_CreateHandleTagList(REG(a0) struct Screen *Screen,REG(a1) struct TagItem *TagList)
  225. {
  226.     LayoutHandle *    Handle;
  227.     struct Screen *    PubScreen;
  228.     APTR            Pool;
  229.     ULONG            WA_ScreenTag;
  230.     BOOL            UnlockThePubScreen;
  231.     LONG            TopGroupType = -1; 
  232.  
  233.     #ifdef DO_PICKSHORTCUTS
  234.     {
  235.         ObtainSemaphore(<P_KeySemaphore);
  236.  
  237.         if(!LTP_Keys[1])
  238.         {
  239.             UBYTE mapBuffer[2 * 3];
  240.             UBYTE remapBuffer[10];
  241.             LONG i;
  242.             struct InputEvent event;
  243.  
  244.             LTP_Keys[1] = <P_Keys[0][256];
  245.  
  246.             for(i = 32 ; i < 256; i++)
  247.             {
  248.                 if(i == 128)
  249.                     i = 160;
  250.  
  251.                 remapBuffer[0] = i;
  252.                 remapBuffer[1] = 0;
  253.  
  254.                 if(MapANSI(remapBuffer,1,mapBuffer,3,NULL) == 1)
  255.                 {
  256.                     if(!(mapBuffer[1] & ~QUALIFIER_SHIFT))
  257.                     {
  258.                         event.ie_NextEvent            = NULL;
  259.                         event.ie_Class                = IECLASS_RAWKEY;
  260.                         event.ie_SubClass            = 0;
  261.                         event.ie_Code                 = mapBuffer[0];
  262.                         event.ie_Qualifier            = mapBuffer[1] & ~QUALIFIER_SHIFT;
  263.                         event.ie_position.ie_addr    = NULL;
  264.  
  265.                         if(MapRawKey(&event,remapBuffer,10,NULL) == 1)
  266.                             LTP_Keys[0][i] = remapBuffer[0];
  267.  
  268.                         event.ie_NextEvent            = NULL;
  269.                         event.ie_Class                = IECLASS_RAWKEY;
  270.                         event.ie_SubClass            = 0;
  271.                         event.ie_Code                 = mapBuffer[0];
  272.                         event.ie_Qualifier            = mapBuffer[1] | QUALIFIER_SHIFT;
  273.                         event.ie_position.ie_addr    = NULL;
  274.  
  275.                         if(MapRawKey(&event,remapBuffer,10,NULL) == 1)
  276.                             LTP_Keys[1][i] = remapBuffer[0];
  277.                     }
  278.                 }
  279.             }
  280.         }
  281.  
  282.         ReleaseSemaphore(<P_KeySemaphore);
  283.     }
  284.     #endif    /* DO_PICKSHORTCUTS */
  285.  
  286.     UnlockThePubScreen = TRUE;
  287.     WA_ScreenTag = WA_CustomScreen;
  288.  
  289.     if(!Screen)
  290.     {
  291.         if(PubScreen = (struct Screen *)GetTagData(LAHN_PubScreen,NULL,TagList))
  292.         {
  293.             UnlockThePubScreen = FALSE;
  294.             WA_ScreenTag = WA_PubScreen;
  295.             Screen = PubScreen;
  296.         }
  297.         else
  298.         {
  299.             STRPTR PubName;
  300.  
  301.             if(PubName = (STRPTR)GetTagData(LAHN_PubScreenName,NULL,TagList))
  302.             {
  303.                 if(!(PubScreen = LockPubScreen(PubName)))
  304.                 {
  305.                     if(!GetTagData(LAHN_PubScreenFallBack,TRUE,TagList))
  306.                         return(NULL);
  307.                 }
  308.             }
  309.             else
  310.                 PubScreen = NULL;
  311.  
  312.             if(!PubScreen)
  313.                 PubScreen = LockPubScreen(NULL);
  314.  
  315.             if(!PubScreen)
  316.                 return(NULL);
  317.             else
  318.             {
  319.                 Screen = PubScreen;
  320.                 WA_ScreenTag = WA_PubScreen;
  321.             }
  322.         }
  323.     }
  324.     else
  325.     {
  326.         PubScreen = NULL;
  327.         UnlockThePubScreen = FALSE;
  328.     }
  329.  
  330.     if(Pool = AsmCreatePool(MEMF_PUBLIC | MEMF_ANY | MEMF_CLEAR,1024,1024,SysBase))
  331.     {
  332.         if(Handle = AsmAllocPooled(Pool,sizeof(LayoutHandle),SysBase))
  333.         {
  334.             struct TagItem    *List,
  335.                             *Entry;
  336.             BOOL             MenuGlyphs;
  337.  
  338.             MenuGlyphs = FALSE;
  339.  
  340.             Handle->Pool                = Pool;
  341.             Handle->Screen                = Screen;
  342.             Handle->PubScreen            = PubScreen;
  343.             Handle->PointBack            = Handle;
  344.             Handle->GroupID                = PHANTOM_GROUP_ID;
  345.  
  346.             Handle->WA_ScreenTag        = WA_ScreenTag;
  347.             Handle->UnlockPubScreen        = UnlockThePubScreen;
  348.  
  349.             Handle->ExitFlush            = TRUE;
  350.             Handle->RawKeyFilter        = TRUE;
  351.             Handle->StandardEditHook    = &Handle->DefaultEditHook;
  352.  
  353.             #ifdef DO_CLONING
  354.             {
  355.                 Handle->CloningPermitted    = TRUE;
  356.             }
  357.             #endif
  358.  
  359.             List = TagList;
  360.  
  361.             while(Entry = NextTagItem(&List))
  362.             {
  363.                 switch(Entry->ti_Tag)
  364.                 {
  365.                     case LH_Font:
  366.  
  367.                         Handle->InitialTextAttr = (struct TextAttr *)Entry->ti_Data;
  368.                         break;
  369.  
  370.                     case LH_MenuGlyphs:
  371.  
  372.                         MenuGlyphs = Entry->ti_Data;
  373.                         break;
  374.  
  375.                     case LH_Parent:
  376.  
  377.                         Handle->Parent = (struct Window *)Entry->ti_Data;
  378.                         break;
  379.  
  380.                     case LH_BlockParent:
  381.  
  382.                         Handle->BlockParent = Entry->ti_Data;
  383.                         break;
  384.  
  385.                     case LH_ExitFlush:
  386.  
  387.                         Handle->ExitFlush = Entry->ti_Data;
  388.                         break;
  389.  
  390.                     case LH_UserData:
  391.  
  392.                         Handle->UserData = (APTR)Entry->ti_Data;
  393.                         break;
  394.  
  395.                     case LH_RawKeyFilter:
  396.  
  397.                         Handle->RawKeyFilter = Entry->ti_Data;
  398.                         break;
  399.  
  400.                     case LH_AutoActivate:
  401.  
  402.                         Handle->AutoActivate = Entry->ti_Data;
  403.                         break;
  404.  
  405.                     case LH_LocaleHook:
  406.  
  407.                         Handle->LocaleHook = (struct Hook *)Entry->ti_Data;
  408.                         break;
  409.  
  410.                     case LH_EditHook:
  411.  
  412.                         Handle->StandardEditHook = (struct Hook *)Entry->ti_Data;
  413.                         break;
  414.  
  415.                     case LAHN_NoKeys:
  416.  
  417.                         Handle->NoKeys = Entry->ti_Data;
  418.                         break;
  419.  
  420.                     #ifdef DO_CLONING
  421.                     {
  422.                         case LH_CloningPermitted:
  423.  
  424.                             Handle->CloningPermitted = Entry->ti_Data;
  425.                             break;
  426.  
  427.                         case LH_SimpleClone:
  428.  
  429.                             if(Handle->SimpleClone = Entry->ti_Data)
  430.                                 Handle->ExactClone = FALSE;
  431.  
  432.                             break;
  433.  
  434.                         case LH_ExactClone:
  435.  
  436.                             if(Handle->ExactClone = Entry->ti_Data)
  437.                                 Handle->SimpleClone = FALSE;
  438.  
  439.                             break;
  440.  
  441.                         case LAHN_CloneScreenTitle:
  442.  
  443.                             Handle->CloneScreenTitle = (STRPTR)Entry->ti_Data;
  444.                             break;
  445.                     }
  446.                     #endif
  447.  
  448.                     case LAHN_TopGroupType:
  449.  
  450.                         if(Entry->ti_Data == HORIZONTAL_KIND ||
  451.                            Entry->ti_Data == VERTICAL_KIND)
  452.                         {
  453.                             TopGroupType = (LONG)Entry->ti_Data;
  454.                         }
  455.                         
  456.                         break;
  457.                 }
  458.             }
  459.  
  460.             #ifdef DO_CLONING
  461.             {
  462.                 if(Handle->LocaleHook)
  463.                 {
  464.                     if(Entry = FindTagItem(LAHN_CloneScreenTitle,TagList))
  465.                         Handle->CloneScreenTitle = (STRPTR)CallHookPkt(Handle->LocaleHook,Handle,(APTR)Entry->ti_Data);
  466.                 }
  467.             }
  468.             #endif
  469.  
  470.             #ifdef DO_PASSWORD_KIND
  471.             {
  472.                 Handle->PasswordEditHook.h_Entry    = (HOOKFUNC)LTP_PasswordEditRoutine;
  473.                 Handle->PasswordEditHook.h_Data        = Handle;
  474.             }
  475.             #endif
  476.  
  477.             Handle->DefaultEditHook.h_Entry    = (HOOKFUNC)LTP_DefaultEditRoutine;
  478.             Handle->DefaultEditHook.h_Data    = Handle;
  479.  
  480.             Handle->BackfillHook.h_Entry    = (HOOKFUNC)LTP_BackfillRoutine;
  481.             Handle->BackfillHook.h_Data     = Handle;
  482.  
  483.             #ifdef DO_HEXHOOK
  484.             {
  485.                 Handle->HexEditHook.h_Entry     = (HOOKFUNC)LTP_HexEditRoutine;
  486.                 Handle->HexEditHook.h_Data        = Handle;
  487.             }
  488.             #endif
  489.  
  490.             if(Handle->DrawInfo = GetScreenDrawInfo(Screen))
  491.             {
  492.                 LONG i;
  493.  
  494.                 Handle->TextPen            = Handle->DrawInfo->dri_Pens[TEXTPEN];
  495.                 Handle->BackgroundPen    = Handle->DrawInfo->dri_Pens[BACKGROUNDPEN];
  496.                 Handle->ShinePen        = Handle->DrawInfo->dri_Pens[SHINEPEN];
  497.                 Handle->ShadowPen        = Handle->DrawInfo->dri_Pens[SHADOWPEN];
  498.                 Handle->AspectX            = Handle->DrawInfo->dri_Resolution.X;
  499.                 Handle->AspectY            = Handle->DrawInfo->dri_Resolution.Y;
  500.  
  501.                 if(Handle->BackgroundPen)
  502.                     InitRastPort(&Handle->BackfillRastPort);
  503.  
  504.                 if(V39 && MenuGlyphs)
  505.                 {
  506.                     LONG i,Size,Width,Height = Handle->DrawInfo->dri_Font->tf_Baseline + 2;
  507.                     struct Image **Glyphs[2];
  508.  
  509.                     Glyphs[0] = &Handle->AmigaGlyph;
  510.                     Glyphs[1] = &Handle->CheckGlyph;
  511.  
  512.                     if(Screen->Flags & SCREENHIRES)
  513.                         Size = SYSISIZE_MEDRES;
  514.                     else
  515.                         Size = SYSISIZE_LOWRES;
  516.  
  517.                     for(i = 0 ; i < 2 ; i++)
  518.                     {
  519.                         if(i)
  520.                             Width = (Height * Handle->AspectY) / Handle->AspectX;
  521.                         else
  522.                             Width = (Height * 3 * Handle->AspectY) / (2 * Handle->AspectX);
  523.  
  524.                         if(!(*Glyphs[i] = NewObject(NULL,SYSICLASS,
  525.                             SYSIA_DrawInfo, Handle->DrawInfo,
  526.                             SYSIA_Size,        Size,
  527.                             SYSIA_Which,    i ? MENUCHECK : AMIGAKEY,
  528.                             IA_Width,        Width,
  529.                             IA_Height,        Height,
  530.                         TAG_DONE)))
  531.                         {
  532.                             DisposeObject(*Glyphs[0]);
  533.                             *Glyphs[0] = NULL;
  534.  
  535.                             break;
  536.                         }
  537.                     }
  538.                 }
  539.  
  540.                 for(i = 0 ; i < Handle->DrawInfo->dri_NumPens ; i++)
  541.                 {
  542.                     if(Handle->DrawInfo->dri_Pens[i] > Handle->MaxPen)
  543.                         Handle->MaxPen = Handle->DrawInfo->dri_Pens[i];
  544.                 }
  545.  
  546.                 if(V39)
  547.                 {
  548.                     STATIC const ULONG DefaultItems[] =
  549.                     {
  550.                         IA_Width,        10,
  551.                         IA_Height,        10,
  552.                         IA_EdgesOnly,    TRUE,
  553.                         IA_Recessed,    TRUE,
  554.  
  555.                         TAG_DONE
  556.                     };
  557.  
  558.                     Handle->BevelImage = (struct Image *)NewObject(NULL,FRAMEICLASS,
  559.                         IA_FrameType,    FRAME_BUTTON,
  560.                     TAG_MORE,DefaultItems);
  561.  
  562.                     Handle->GrooveImage = (struct Image *)NewObject(NULL,FRAMEICLASS,
  563.                         IA_FrameType,    FRAME_RIDGE,
  564.                     TAG_MORE,DefaultItems);
  565.  
  566.                         /* Check if the class has been replaced, assuming that the
  567.                          * replacement will live in memory rather than in ROM space.
  568.                          */
  569.  
  570.                     if(Handle->GrooveImage)
  571.                     {
  572.                         if(TypeOfMem(OCLASS(Handle->GrooveImage)->cl_Dispatcher.h_Entry))
  573.                             Handle->UseGroove = TRUE;
  574.                     }
  575.                 }
  576.  
  577.                 if(Handle->VisualInfo = GetVisualInfoA(Screen,NULL))
  578.                 {
  579.                     InitRastPort(&Handle->RPort);
  580.  
  581.                     if(LTP_GlyphSetup(Handle,Handle->InitialTextAttr))
  582.                     {
  583.                         #ifdef DO_PICKSHORTCUTS
  584.                         {
  585.                             memset(Handle->Keys,TRUE,256);
  586.  
  587.                             for(i = 0 ; i < 256 ; i++)
  588.                             {
  589.                                 if(i != 32 && i != 160)
  590.                                 {
  591.                                     if(LTP_Keys[0][i])
  592.                                         Handle->Keys[LTP_Keys[0][i]] = FALSE;
  593.  
  594.                                     if(LTP_Keys[1][i])
  595.                                         Handle->Keys[LTP_Keys[1][i]] = FALSE;
  596.                                 }
  597.                             }
  598.                         }
  599.                         #endif
  600.  
  601.                         if(TopGroupType != -1)
  602.                         {
  603.                             LT_AddA(Handle,TopGroupType,NULL,-1,NULL);
  604.  
  605.                             Handle->CloseTopGroup = TRUE;
  606.                         }
  607.  
  608.                         return(Handle);
  609.                     }
  610.                 }
  611.             }
  612.  
  613.             LT_DeleteHandle(Handle);
  614.         }
  615.         else
  616.             AsmDeletePool(Pool,SysBase);
  617.     }
  618.     else
  619.         UnlockPubScreen(NULL,PubScreen);
  620.  
  621.     return(NULL);
  622. }
  623.